import db from "../utils/db"


export function getCustomer(name) {
  return db.customers.where("name").equalsIgnoreCase(name).toArray();
}

export function listCustomers() {
    return db.customers.orderBy("id").reverse().toArray();
}

export function addCustomer(data) {
  db.customers.add(data);
}

export function deleteCustomer(id) {
  db.customers.delete(id)
}

export function modifyCustomer(data) {
  db.customers.put(data);
}
